﻿@model IEnumerable<YQBlog.Models.ArtilceWithDecorate> 
@using res = Resource.Views.Home.Home;
@{
    YQBlog.General.GeneralConfigInfo ci = ViewBag.CI as YQBlog.General.GeneralConfigInfo;
    string themepath = string.IsNullOrWhiteSpace(Request.Cookies["web"]["theme"]) ? "/Content/" : "/Themes/" + Request.Cookies["web"]["theme"].ToString() + "/Style/";
}
<div class="web_path">@res.Path：@Html.ActionLink(res.HomePage, "Index", "Home") \ @Html.Raw(ViewBag.WebPath)</div>
<div class="page_wrap">
    <div id="page">
        <div class="page_inner">
    @if ((Model as IEnumerable<YQBlog.Models.blog_varticle>).Count() > 0)
    {
        foreach (var item in Model)
        {
            <div class="post bottom_border" id="post-@(item.id)">
                <div class="preview">
                    @if ((bool)ViewBag.HasSub)
                    {
                    <div class="post_taxonomy">
                      @Html.Raw(item.catepath)        
                    </div>
                    }
                    <h1 class="post_title">
                          @if (item.subcount==0 && item.istop==1)
                          {   
                             @:[@res.Top]
                          } 
                        <a title="@item.title" href="@Html.YQUrl(item)">@item.title</a>
                    </h1>
                <div class="post_meta">
                <span class="post_meta_words">
                      @Html.GetTime(item.createdate)
                      @if (item.subcount > 0)
                      {   
                        <a title="Comment" href="@Html.YQUrl(item)#comment"> @item.subcount @res.Comments</a> 
                      } 
                </span>                     
                </div> 
                <div class="text">
                    <div class="textcontent">
                        @Html.Raw(item.summary)
                    </div>
                    <p class="more-link-wrap">(<a class="more-link" href="@Html.YQUrl(item)">@res.Continue</a>)</p> 
                </div>
                </div>           
             </div>
        }
    }
    else
    {
        <h2 class="nodata">@res.NoData</h2> 
    }
    
            <div class="pager">
            </div>
        </div>
    </div>       
</div>

<div id="sidebar">
</div>
@section Js{
    <script src="@Url.Content("~/Scripts/jquery.pager.js")" type="text/javascript"></script>
    <script type="text/javascript">
        var pageNo = @ViewBag.PageNo;
        var pageCount = @ViewBag.PageCount;
        $(function () {
            if (pageCount == 0) { $(".pager").hide() }
            $(".pager").pager({ pagenumber: pageNo, pagecount: pageCount, buttonClickCallback: PageClick });
        });

        PageClick = function (no) {
            window.location = "?p=" + no;
        }
    </script>
}